#include<stdio.h>
int main()
{
	int n,i,num;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&num);
		for(int j=2;j<=num;j+=2)
		{
			if((num%j)==0)
			  printf("%d ",j);
			else if((num%j!=0)&&(j==num-1))
			  printf("%d has no even factors\n",num);
		}
	}
	return 0;
}
